<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>报表打印预览</title>
    <meta name="decorator" content="ani"/>
    <style>
        .center{
            text-align: center;
        }
    </style>
    <script type="text/javascript" src="${ctxStatic1}/webpage/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctxStatic1}/webpage/static/js/jquery.media.js"></script>
    <script type="text/javascript">
        /*window.onload = function(){
            methodsOne()
        }
        function methodsOne(){
            window.open("${ctx}/getPdf?pdfName=${pdfName}");
        }*/
        $(function() {
            // $.ajax({
             	<%--url: '${ctx}/buzz/factbill/factBill/getPdf',--%>
            	// cache: false,
            	// dataType: 'text',
            	// success: function(res) {
            	// 	if (res=="1") {
                       /* window.open("${ctx}/getPdf?pdfName=${pdfName}");*/
                        $("#printArea").attr("href","${ctx}/getPdf?pdfName=${pdfName}")
                        $('a.media').media({width:830, height:500});
            		// }
            	// },
            	// error: function(XMLHttpRequest, textStatus, errorThrown) {
            	// 	if ($.isFunction(defaults.error)) {
            	// 		defaults.error(XMLHttpRequest, textStatus, errorThrown);
            	// 	}
            	// }
            // });
            // window.addEventListener('beforeprint',function (ev) {
            //     console.log(ev)
                // document.body.innerHTML = '正在打印...';
                // beforePrint()
            // });
            // window.addEventListener('afterprint',function (ev) {
                // document.body.innerHTML = '打印完成...';
                // console.log(ev)
                // afterPrint()
            // });

        });



        // function beforePrint() {
        //     console.log('Functionality to run before printing.');
        // };
        //
        // function afterPrint() {
        //     console.log('Functionality to run after printing');
        // };

    </script>
</head>
<body>
<div class="center">
    <div class="panel panel-primary">
        <div class="panel-body" align="center">
            <a id="printArea" class="media" href=""></a>
        </div>
    </div>
</div>
</body>
</html>
